package com.teamsun.mqtt.entity.vo;

import io.netty.buffer.ByteBuf;
import io.netty.handler.codec.mqtt.MqttQoS;

/**
 * 用于发送的消息对象
 * @author acer
 *
 */
public class SendableMsg {

	
	 /**
	  * 主题
	  */
	 private String topname;
	 
	 /**
	  * 接受客户端标识
	  */
	 private String recvclientid;
	 
	 /**
	  * 发送方
	  */
	 private String sendclientid;
	 
	 private Integer messageid;
	 
	 
	 private ByteBuf msgContent;
	 
	 /**
	  * 保留标识
	  */
	 boolean  retain;
	 
	 /**
	  * 重发标识
	  */
	 int  dupTimes;
	 
	 /**
	  * 服务质量
	  */
	 MqttQoS qoS;
	 
	 
	 public SendableMsg(){
		 
	 }
	 
	 public SendableMsg(SendableMsg sendableMsg){
		 	this.topname = sendableMsg.topname;
			this.sendclientid = sendableMsg.sendclientid;
			this.messageid = sendableMsg.messageid;
			this.msgContent = sendableMsg.msgContent;
			this.retain = sendableMsg.retain;
			this.dupTimes = sendableMsg.dupTimes;
			this.qoS = sendableMsg.qoS;
	 }
	 


	public SendableMsg(String topname, String recvclientid, String sendclientid, Integer messageid, ByteBuf msgContent,
			boolean retain, int dupTimes, MqttQoS qoS) {
		super();
		this.topname = topname;
		this.recvclientid = recvclientid;
		this.sendclientid = sendclientid;
		this.messageid = messageid;
		this.msgContent = msgContent;
		this.retain = retain;
		this.dupTimes = dupTimes;
		this.qoS = qoS;
	}




	public String getTopname() {
		return topname;
	}


	public void setTopname(String topname) {
		this.topname = topname;
	}


	public String getRecvclientid() {
		return recvclientid;
	}


	public SendableMsg setRecvclientid(String recvclientid) {
		this.recvclientid = recvclientid;
		return  this;
	}


	public Integer getMessageid() {
		return messageid;
	}


	public void setMessageid(Integer messageid) {
		this.messageid = messageid;
	}


	public ByteBuf getMsgContent() {
		return msgContent;
	}


	public void setMsgContent(ByteBuf msgContent) {
		this.msgContent = msgContent;
	}


	public boolean isRetain() {
		return retain;
	}


	public void setRetain(boolean retain) {
		this.retain = retain;
	}




	public MqttQoS getQoS() {
		return qoS;
	}


	public void setQoS(MqttQoS qoS) {
		this.qoS = qoS;
	}


	public int getDupTimes() {
		return dupTimes;
	}


	public void setDupTimes(int dupTimes) {
		this.dupTimes = dupTimes;
	}


	public String getSendclientid() {
		return sendclientid;
	}


	public void setSendclientid(String sendclientid) {
		this.sendclientid = sendclientid;
	}

   
	 
	 
	 
	 
	
}
